<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

//Route::middleware('auth:api')->get('/user', function (Request $request) {
//    return $request->user();
//});
Route::group(['namespace'=>'Auth'],function (){
    Route::post('/login', 'UserController@login');
    Route::post('/logout', 'UserController@logout');
    Route::get('/getLoginStatus', 'UserController@getLoginStatus');
    Route::post('/register', 'UserController@register');
    Route::post('/webregister', 'UserController@webregister');
    Route::get('/sendCode', 'UserController@sendCode');
    Route::middleware('admin')->group(function (){

        Route::get('/getUsers', 'UserController@getUsers');
        Route::post('/manageUser', 'UserController@manageUser');

        Route::get('/getNews', 'NewsController@getNews');
        Route::post('/addNews', 'NewsController@addNews');

        Route::get('/getKnowledges', 'KnowledgesController@getKnowledges');
        Route::post('/addKnowledges', 'KnowledgesController@addKnowledges');

        Route::get('/getBusinesses', 'BusinessesController@getBusinesses');
        Route::post('/addBusinesses', 'BusinessesController@addBusinesses');

        Route::get('/getTransaction', 'TransactionController@getTransaction');
        Route::post('/addTransaction', 'TransactionController@addTransaction');

        Route::get('/getGoods', 'GoodsController@getGoods');
        Route::post('/addGoods', 'GoodsController@addGoods');

        Route::get('/getPresident', 'PresidentController@getPresident');
        Route::post('/addPresident', 'PresidentController@addPresident');

        Route::get('/getSchedule', 'ScheduleController@getSchedule');
        Route::post('/addSchedule', 'ScheduleController@addSchedule');

        Route::get('/getInfo', 'AboutController@getInfo');
        Route::post('/updateInfo', 'AboutController@updateInfo');

        Route::post('/upload', 'UploadController@upload');
        Route::post('/removeFile', 'UploadController@removeFile');

        Route::get('/getOfficer', 'OfficerController@getOfficer');
        Route::get('/getJobads', 'OfficerController@getJobads');
        Route::post('/addOfficer', 'OfficerController@addOfficer');
        Route::post('/addJobads', 'OfficerController@addJobads');

    });

});
    Route::get('/test','TestController@test1');
Route::get('/wxShare', 'TestController@wxShare');
